package org.hqmdev.singleton;

/**
 * Lazy Initialization Singleton
 * Drawback: can cause issues if multiple threads inside the if block at 
 * the same time
 * @author hqm2zxy
 *
 */
public class LazyInitializedSingleton {
	
	private static LazyInitializedSingleton instance;
	
	private LazyInitializedSingleton() {}
	
	public static LazyInitializedSingleton getInstance() {
		if (instance == null) {
			instance = new LazyInitializedSingleton();
		}
		
		return instance;
	}
}
